import { defineConfig } from 'vite'
import { resolve } from "path";
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: [
      {
        find: '@',
        replacement: resolve(__dirname, "src"),
      },
      {
        find: 'comps',
        replacement: resolve(__dirname, "src/components"),
      },
      {
        find: 'apis',
        replacement: resolve(__dirname, "src/apis"),
      },
      {
        find: 'pages',
        replacement: resolve(__dirname, "src/pages"),
      },
      {
        find: 'routes',
        replacement: resolve(__dirname, "src/router"),
      },
      {
        find: 'store',
        replacement: resolve(__dirname, "src/store"),
      },
      {
        find: 'utils',
        replacement: resolve(__dirname, "src/utils"),
      },
      {
        find: 'styles',
        replacement: resolve(__dirname, "src/styles"),
      },
      {
        find: 'layout',
        replacement: resolve(__dirname, "src/Layout"),
      },
      {
        find: 'models',
        replacement: resolve(__dirname, "src/models"),
      },
      {
        find: 'hooks',
        replacement: resolve(__dirname, 'src/hooks')
      }
    ]
  }
})
